{
  "properties" : { },
  "id" : "copy1663035528282d59435",
  "script" : null,
  "groupId" : "9e0a5d32171c4700a791fb1f1eb129c5",
  "name" : "清洗型按区域统计",
  "createTime" : null,
  "updateTime" : 1663049930635,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/clean/byProvince",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ {
    "name" : "default_data_source",
    "value" : "cks_dev",
    "description" : "配置默认数据源的key",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "{\r\n    \"fac\":\"马应龙\"\r\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 200,\n    \"message\": \"success\",\n    \"data\": [{\n        \"province\": \"吉林市\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 1.0,\n        \"marketVar\": 1.0\n    }, {\n        \"province\": \"安徽省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 10688.0,\n        \"marketVar\": 10688.0\n    }, {\n        \"province\": \"北京市\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 7685.0,\n        \"marketVar\": 7685.0\n    }, {\n        \"province\": \"福建省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 11313.0,\n        \"marketVar\": 11313.0\n    }, {\n        \"province\": \"甘肃省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 5428.0,\n        \"marketVar\": 5428.0\n    }, {\n        \"province\": \"广东省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 24133.0,\n        \"marketVar\": 24133.0\n    }, {\n        \"province\": \"广西壮族自治区\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 8020.0,\n        \"marketVar\": 8020.0\n    }, {\n        \"province\": \"贵州省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 7819.0,\n        \"marketVar\": 7819.0\n    }, {\n        \"province\": \"海南省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 1913.0,\n        \"marketVar\": 1913.0\n    }, {\n        \"province\": \"河北省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 13877.0,\n        \"marketVar\": 13877.0\n    }, {\n        \"province\": \"河南省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 15119.0,\n        \"marketVar\": 15119.0\n    }, {\n        \"province\": \"黑龙江省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 8173.0,\n        \"marketVar\": 8173.0\n    }, {\n        \"province\": \"湖北省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 25752.0,\n        \"marketVar\": 25752.0\n    }, {\n        \"province\": \"湖南省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 11687.0,\n        \"marketVar\": 11687.0\n    }, {\n        \"province\": \"吉林省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 10507.0,\n        \"marketVar\": 10507.0\n    }, {\n        \"province\": \"江苏省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 30882.0,\n        \"marketVar\": 30882.0\n    }, {\n        \"province\": \"江西省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 7094.0,\n        \"marketVar\": 7094.0\n    }, {\n        \"province\": \"辽宁省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 19723.0,\n        \"marketVar\": 19723.0\n    }, {\n        \"province\": \"内蒙古自治区\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 7225.0,\n        \"marketVar\": 7225.0\n    }, {\n        \"province\": \"宁夏回族自治区\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 1892.0,\n        \"marketVar\": 1892.0\n    }, {\n        \"province\": \"青海省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 2939.0,\n        \"marketVar\": 2939.0\n    }, {\n        \"province\": \"山东省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 22366.0,\n        \"marketVar\": 22366.0\n    }, {\n        \"province\": \"山西省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 8668.0,\n        \"marketVar\": 8668.0\n    }, {\n        \"province\": \"陕西省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 16435.0,\n        \"marketVar\": 16435.0\n    }, {\n        \"province\": \"上海市\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 7543.0,\n        \"marketVar\": 7543.0\n    }, {\n        \"province\": \"四川省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 28103.0,\n        \"marketVar\": 28103.0\n    }, {\n        \"province\": \"天津市\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 4643.0,\n        \"marketVar\": 4643.0\n    }, {\n        \"province\": \"西藏自治区\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 262.0,\n        \"marketVar\": 262.0\n    }, {\n        \"province\": \"新疆维吾尔自治区\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 5196.0,\n        \"marketVar\": 5196.0\n    }, {\n        \"province\": \"云南省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 24102.0,\n        \"marketVar\": 24102.0\n    }, {\n        \"province\": \"浙江省\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 20036.0,\n        \"marketVar\": 20036.0\n    }, {\n        \"province\": \"重庆市\",\n        \"rawAll\": 0.0,\n        \"rawVar\": 0.0,\n        \"ascAll\": 0.0,\n        \"ascDay\": 0.0,\n        \"marketAll\": 8672.0,\n        \"marketVar\": 8672.0\n    }],\n    \"timestamp\": 1663035597092,\n    \"executeTime\": 198\n}",
  "description" : null,
  "requestBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "fac",
      "value" : "马应龙",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "200",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ {
        "name" : "",
        "value" : "",
        "description" : "",
        "required" : false,
        "dataType" : "Object",
        "type" : null,
        "defaultValue" : null,
        "validateType" : "",
        "error" : "",
        "expression" : "",
        "children" : [ {
          "name" : "province",
          "value" : "吉林市",
          "description" : "",
          "required" : false,
          "dataType" : "String",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "rawAll",
          "value" : "0.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "rawVar",
          "value" : "0.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "ascAll",
          "value" : "0.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "ascDay",
          "value" : "0.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "marketAll",
          "value" : "1.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "marketVar",
          "value" : "1.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        } ]
      } ]
    }, {
      "name" : "timestamp",
      "value" : "1663035597092",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "198",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
db.select(
    """
    SELECT
        province,sum(raw_all) raw_all,sum(raw_var) raw_var,sum(asc_all) asc_all,sum(asc_day) asc_day,sum(market_all) market_all,sum(market_var) market_var
    FROM
        st_md_by_pr
    WHERE
        type_code=21
        ?{body.bigType,and big_type = #{bigType}}
    AND fac = #{body.fac}
    AND date_str = (SELECT max(date_str) FROM `st_md_by_pr` where fac = #{body.fac})
    group by province
    ORDER BY pr_order
    """
)